<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/template.xhtml">
	
<ui:define name="title">
		<h3><h:outputLabel	value="#{i18n['erp.matricula.nivel.pagina.titulo']}" /></h3>
	</ui:define>	

	
<ui:define name="content">
		<h:form id="formNivel">
		
			<p:growl id="pnlMessages" autoUpdate="true" closable="true"/>
			
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton id="btnRefrescar" value="Refrescar" icon="ui-icon-arrowrefresh-1-w" >
					</p:commandButton>
					<p:commandButton id="btnNuevoNivel" value="Insertar" icon="ui-icon ui-icon-circle-plus" oncomplete="dlgNuevoNivel.show()">
						</p:commandButton>
				</p:toolbarGroup>
			</p:toolbar>
			<p:panel id="pnlBuscarNivel" header="#{i18n['erp.matricula.nivel.buscar']}">
				<table class="formulario" id="tableStyleRe">
					
						<tr >
						<td width="30%"><h:outputLabel value="#{i18n['erp.matricula.nivel.descripcion']}" /> 
						</td>
						<td width="60%">
							<p:inputText id="txtNivelBuscar" style="width:400px"
								value="#{nivelDataManager.nivelBuscar.nivDescaripcion}" />
						</td>
						<td width="10%">
						<p:commandButton id="btnBuscar"
					actionListener="#{nivelController.buscarNivel}"
					value="#{i18n['label.buscar']}" 
					process="@this,pnlBuscarNivel"
					icon="ui-icon-search"
					update=":formNivel:pnlMessages,tablaNivel,pnlBuscarNivel" />
						</td>
						</tr>
				</table>
			</p:panel>

		<p:panel id="botonesBuscar">
				
		</p:panel>


		<p:dataTable id="tablaNivel"
			value="#{nivelDataManager.nivelDTOs}" var="niveles"
			rowIndexVar="rowIndex"
			paginator="true" rows="5" paginatorPosition="bottom"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="5,10,15" emptyMessage="#{i18n['erp.matricula.nivel.lista']}">
			<f:facet name="header">
				#{i18n['erp.matricula.nivel.lista']}
			</f:facet>
			<p:column headerText="#" styleClass="centered" width="5%">
				#{rowIndex+1}
			</p:column>
					
			<p:column headerText="#{i18n['erp.matricula.nivel.descripcion']}" width="35%">
				<h:outputText value="#{niveles.nivDescaripcion}" />
			</p:column>
			<p:column headerText="#{i18n['label.opciones']}" styleClass="centered" width="10%">
				<h:panelGroup>
					<p:commandLink styleClass="no-decor"
							title="#{i18n['label.editar']}"
							oncomplete="dlgEditarNivel.show()"
							actionListener="#{nivelController.cargarDatosNivel(niveles)}"
							process="@this" update=":formEditarNivel:pnlEditarNivel">
							<h:graphicImage value="/resources/img/edit.png" alt="#{i18n['label.editar']}"/>
					</p:commandLink>
				</h:panelGroup>
			</p:column>
										
		</p:dataTable>			
	
</h:form>			
		
		
<ui:include src="dialogNuevoNivel.xhtml" />		
<ui:include src="dialogEditarNivel.xhtml" />	
		
	</ui:define>
</ui:composition>